package com.git.service.impl;

import com.git.entity.User;
import com.git.mapper.UserMapper;
import com.git.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service("userService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    @Transactional
    public void delUserService(int id) {
        userMapper.delUser(id);
    }

    @Override
    @Transactional
    public void upUserService(User user) {
        userMapper.upUser(user);
    }

    @Override
    public List<User> showAllUserService() {
        return userMapper.showAllUser();
    }

    @Override
    @Transactional
    public void addUserService(User user) {

        userMapper.addUser(user);

    }
}
